package com.uwo.commons.samples.beans;

import com.uwo.commons.configuration.aop.validate.annotation.Model;
import com.uwo.commons.configuration.aop.validate.annotation.NotNull;
import com.uwo.commons.configuration.aop.validate.annotation.Pattern;
import com.uwo.commons.kits.StringKits;
import lombok.Data;
//import lombok.extern.log4j.Log4j2;

import java.io.Serializable;

//@Log4j2
@Data
@Model(validateBean = "modelValidate", method = "validateUser")
public class User implements Serializable{

    @NotNull
    private String name;

    @Pattern(pattern = "^((17[0-9])|(14[0-9])|(13[0-9])|(15[^4,\\D])|(18[0,5-9]))\\d{8}$")
    private String mobile;

    @Pattern(pattern = "^([a-z0-9A-Z]+[-|\\.]?)+[a-z0-9A-Z]@([a-z0-9A-Z]+(-[a-z0-9A-Z]+)?\\.)+[a-zA-Z]{2,}$")
    private String mail;

    @NotNull
    private String password;

    @NotNull
    private Object member;

    public void validate(){
        if(!StringKits.isEmpty(name)){

        }else if(!StringKits.isEmpty(mobile)){

        }else if(!StringKits.isEmpty(mail)){

        }
    }

}
